package tmt.usercenter.web.domain.enums;


import com.tmt.annotation.EnumDescriptor;
import com.tmt.annotation.parser.EnumAnnotationParser;

public enum AuthorizedGrantType {

    @EnumDescriptor(title="授权码类型", description = "授权码类型")
    authorization_code,

    @EnumDescriptor(title="隐式授权类型", description = "隐式授权类型")
    implicit,

    @EnumDescriptor(title="用户密码类型", description = "资源所有者（即用户）密码类型")
    password,

    @EnumDescriptor(title="客户端凭据类型", description = "客户端凭据（客户端ID以及Key）类型")
    client_credentials,

    @EnumDescriptor(title="刷新令牌类型", description = "通过其他授权类型获得的刷新令牌来获取新的令牌")
    refresh_token;


    public static AuthorizedGrantType from(String title) {
        return EnumAnnotationParser.convertFromTitle(AuthorizedGrantType.class, title);
    }

}
